using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class RX_PrescriptionMap : EntityTypeConfiguration<RX_Prescription>
    {
        public RX_PrescriptionMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Physician)
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("RX_Prescription");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Physician).HasColumnName("Physician");
            this.Property(t => t.Patient).HasColumnName("Patient");
        }
    }
}
